CMAKE_MINIMUM_REQUIRED(VERSION 3.10 FATAL_ERROR)

PROJECT(thread_singleton_test LANGUAGES CXX)
SET(CMAKE_CXX_STANDARD 14)

INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/)
FILE(GLOB SRC_CPP ${CMAKE_SOURCE_DIR}/src/*.cpp)
FILE(GLOB DATA ${CMAKE_SOURCE_DIR}/data/*.jpg)
FILE(COPY ${DATA} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data)

FIND_PACKAGE(OpenCV REQUIRED)
INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS})

FIND_PACKAGE(OpenMP REQUIRED)
IF(OPENMP_FOUND)
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
ENDIF(OPENMP_FOUND)

ADD_EXECUTABLE(${PROJECT_NAME} main.cpp ${SRC_CPP})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} OpenMP::OpenMP_CXX ${OpenCV_LIBS})